<template>
  <div class="app-container">
    <el-form
      :model="queryParams"
      ref="queryForm"
      size="small"
      :inline="true"
      v-show="showSearch"
      label-width="68px"
    >
      <el-form-item label="出版社编号" prop="publisherNumber">
        <el-input
          v-model="queryParams.publisherNumber"
          placeholder="请输入出版社编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="出版社类型" prop="publishType">
        <el-input
          v-model="queryParams.publishType"
          placeholder="请输入出版社类型"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="出版社名" prop="publishName">
        <el-input
          v-model="queryParams.publishName"
          placeholder="请输入出版社名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button
          type="primary"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          >搜索</el-button
        >
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
          >重置</el-button
        >
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:house:add']"
          >新增</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:house:edit']"
          >修改</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:house:remove']"
          >删除</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:house:export']"
          >导出</el-button
        >
      </el-col>
      <right-toolbar
        :showSearch.sync="showSearch"
        @queryTable="getList"
      ></right-toolbar>
    </el-row>

    <el-table
      v-loading="loading"
      :data="houseList"
      @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="序号" align="center" prop="id" />
      <el-table-column
        label="出版社编号"
        align="center"
        prop="publisherNumber"
      />
      <el-table-column label="出版社类型" align="center" prop="publishType" />
      <el-table-column label="出版社名" align="center" prop="publishName" />
      <!-- <el-table-column label="出版社名(英文)" align="center" prop="publishNameEng" />
      <el-table-column label="出版社名(注册)" align="center" prop="publishNameLogined" />
      <el-table-column label="出版社名(注册)(英文)" align="center" prop="publishNameLoginedEng" />
      <el-table-column label="地址" align="center" prop="address" />
      <el-table-column label="地址(英文)" align="center" prop="addressEng" />
      <el-table-column label="合同上的出版社名" align="center" prop="publishNameInContract" />
      <el-table-column label="合同上的出版社名(英文)" align="center" prop="publishNameInContractEng" />
      <el-table-column label="合同上地址" align="center" prop="addressInContract" />
      <el-table-column label="合同上地址(英文)" align="center" prop="addressInContractEng" />
      <el-table-column label="公司负责人名" align="center" prop="companyChargePeople" />
      <el-table-column label="公司负责人名(英文)" align="center" prop="companyChargePeopleEng" />
      <el-table-column label="签约代表人" align="center" prop="contractRepresentative" />
      <el-table-column label="签约代表人(英文)" align="center" prop="contractRepresentativeEng" />
      <el-table-column label="职称" align="center" prop="position" />
      <el-table-column label="职称(英文)" align="center" prop="positionEng" />
      <el-table-column label="电话" align="center" prop="phone" />
      <el-table-column label="传真" align="center" prop="fax" />
      <el-table-column label="电邮" align="center" prop="email" />
      <el-table-column label="官网" align="center" prop="officialWebsite" />
      <el-table-column label="签约方式,多个用英文逗号隔开" align="center" prop="signWay" />
      <el-table-column label="发行者,多个用英文逗号隔开" align="center" prop="publisher" />
      <el-table-column label="电子签约种类,多个用英文逗号隔开" align="center" prop="contractTyoeOnline" />
      <el-table-column label="To" align="center" prop="to" />
      <el-table-column label="CC" align="center" prop="cc" />
      <el-table-column label="银行名称(当地名称)" align="center" prop="bankNameLocal" />
      <el-table-column label="银行名称(英文)" align="center" prop="bankNameEng" />
      <el-table-column label="银行地址(当地)" align="center" prop="bankAddressLocal" />
      <el-table-column label="银行地址(英文)" align="center" prop="bankAddressEng" />
      <el-table-column label="银行账户名称(当地)" align="center" prop="bankAccountNameLocal" />
      <el-table-column label="银行账户名称(英文)" align="center" prop="bankAccountNameEng" />
      <el-table-column label="银行账户号码" align="center" prop="bankAccountNumber" />
      <el-table-column label="SWIFT CODE" align="center" prop="swiftCode" />
      <el-table-column label="发票的公司名" align="center" prop="invoiceCompanyName" />
      <el-table-column label="同一发票号码/纳税人识别号" align="center" prop="invoiceNumber" />
      <el-table-column label="地址/电话" align="center" prop="invoicePhone" />
      <el-table-column label="开户行及账号" align="center" prop="bankDeposit" />
      <el-table-column label="开票时间，首款前/收款后" align="center" prop="invoiceTime" />
      <el-table-column label="开票种类，普通发票/专用发票" align="center" prop="invoiceType" />
      <el-table-column label="发票增值税，内含税/外加税" align="center" prop="invoiceAddedTax" />
      <el-table-column label="公司成立日期" align="center" prop="companyCreatedTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.companyCreatedTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="年度营业额" align="center" prop="annualTurnover" />
      <el-table-column label="出版书种" align="center" prop="publishedBookType" />
      <el-table-column label="原创作品和翻译作品之比例" align="center" prop="rawTranslateScale" />
      <el-table-column label="资本额" align="center" prop="capitalAmount" />
      <el-table-column label="员工人数" align="center" prop="employeesNumber" />
      <el-table-column label="全年出版书种的数量" align="center" prop="yearPublishNumber" />
      <el-table-column label="股东" align="center" prop="stockholder" />
      <el-table-column label="经营项目 " align="center" prop="operatingItems" />
      <el-table-column label="累计出版书种的数量" align="center" prop="allPublishNumber" />
      <el-table-column label="销售渠道" align="center" prop="salesChannel" />
      <el-table-column label="自制畅销书名、原出版社、发行数量" align="center" prop="originalBook" />
      <el-table-column label="翻译畅销书名、发行数量" align="center" prop="translateBook" />
      <el-table-column label="来往之国外出版社(欧美/日本等)" align="center" prop="foreignPublishingHouse" />
      <el-table-column label="来往之版全代理公司名" align="center" prop="copyrightAgency" />
      <el-table-column label="业务上注意点" align="center" prop="businessNoticePoint" />
      <el-table-column label="合同上注意点" align="center" prop="contractNoticePoint" />
      <el-table-column label="付款上注意点" align="center" prop="payNoticePoint" />
      <el-table-column label="其它" align="center" prop="othera" /> -->
      <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
      >
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:house:edit']"
            >修改</el-button
          >
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:house:remove']"
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改出版社对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="140px">
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="出版社编号" prop="publisherNumber">
              <el-input
                v-model="form.publisherNumber"
                placeholder="请输入出版社编号"
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="出版社类型" prop="publishType">
              <el-select
                v-model="form.publishType"
                placeholder="请选择"
                style="width: 100%"
              >
                <el-option
                  v-for="item in obligeeTypeList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
              <!-- <el-input v-model="form.publishType" placeholder="请输入出版社类型" /> -->
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="出版社名" prop="publishName">
              <el-input
                v-model="form.publishName"
                placeholder="请输入出版社名"
              />
            </el-form-item>
          </el-col>
          <el-col :span="12"
            ><el-form-item label="出版社名(英文)" prop="publishNameEng">
              <el-input
                v-model="form.publishNameEng"
                placeholder="请输入出版社名(英文)"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="出版社名(注册)" prop="publishNameLogined">
              <el-input
                v-model="form.publishNameLogined"
                placeholder="请输入出版社名(注册)"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item
              label="出版社名(注册)(英文)"
              prop="publishNameLoginedEng"
              label-width="200px"
            >
              <el-input
                v-model="form.publishNameLoginedEng"
                placeholder="请输入出版社名(注册)(英文)"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="地址" prop="address">
              <el-input
                v-model="form.address"
                placeholder="请输入地址"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="地址(英文)" prop="addressEng">
              <el-input
                v-model="form.addressEng"
                placeholder="请输入地址(英文)"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item
              label="合同上的出版社名"
              prop="publishNameInContract"
            >
              <el-input
                v-model="form.publishNameInContract"
                placeholder="请输入合同上的出版社名"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item
              label="合同上的出版社名(英文)"
              prop="publishNameInContractEng"
              label-width="180px"
            >
              <el-input
                v-model="form.publishNameInContractEng"
                placeholder="请输入合同上的出版社名(英文)"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="合同上地址" prop="addressInContract">
              <el-input
                v-model="form.addressInContract"
                placeholder="请输入合同上地址"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="合同上地址(英文)" prop="addressInContractEng">
              <el-input
                v-model="form.addressInContractEng"
                placeholder="请输入合同上地址(英文)"
              /> </el-form-item
          ></el-col>
          <el-col :span="24">
            <div class="small_title">
              <div class="blur_point"></div>
              <span>公司信息</span>
            </div>
          </el-col>
          <el-col :span="12"
            ><el-form-item label="公司负责人名" prop="companyChargePeople">
              <el-input
                v-model="form.companyChargePeople"
                placeholder="请输入公司负责人名"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item
              label="公司负责人名(英文)"
              prop="companyChargePeopleEng"
            >
              <el-input
                v-model="form.companyChargePeopleEng"
                placeholder="请输入公司负责人名(英文)"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="签约代表人" prop="contractRepresentative">
              <el-input
                v-model="form.contractRepresentative"
                placeholder="请输入签约代表人"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item
              label="签约代表人(英文)"
              prop="contractRepresentativeEng"
            >
              <el-input
                v-model="form.contractRepresentativeEng"
                placeholder="请输入签约代表人(英文)"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="职称" prop="position">
              <el-input
                v-model="form.position"
                placeholder="请输入职称"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="职称(英文)" prop="positionEng">
              <el-input
                v-model="form.positionEng"
                placeholder="请输入职称(英文)"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="电话" prop="phone">
              <el-input
                v-model="form.phone"
                placeholder="请输入电话"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="传真" prop="fax">
              <el-input
                v-model="form.fax"
                placeholder="请输入传真"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="电邮" prop="email">
              <el-input
                v-model="form.email"
                placeholder="请输入电邮"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="官网" prop="officialWebsite">
              <el-input
                v-model="form.officialWebsite"
                placeholder="请输入官网"
              /> </el-form-item
          ></el-col>
          <el-col :span="12">
            <el-form-item label="签约代表姓名/职称/电邮" prop="companyOfficialWebsite" label-width="180px">
              <el-input v-model="form.companyOfficialWebsite" placeholder="请输入签约代表姓名/职称/电邮" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="窗口姓名/职称/电邮" prop="companyOfficialWebsite">
              <el-input v-model="form.companyOfficialWebsite" placeholder="请输入窗口姓名/职称/电邮" />
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <div class="small_title">
              <div class="blur_point"></div>
              <span>签约方式</span>
            </div>
          </el-col>
          <el-col :span="24">
            <el-form-item label="签约方式" prop="signWay">
              <el-checkbox-group v-model="form.signWay" placeholder="请选择签约方式">
                <el-checkbox label="电子签约"></el-checkbox>
                <el-checkbox label="纸本"></el-checkbox>
                <el-checkbox label="PDF"></el-checkbox>
              </el-checkbox-group>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="发行者" prop="publisher">
              <el-checkbox-group v-model="form.publisher" placeholder="请选择发行者">
                <el-checkbox label="权利人发行"></el-checkbox>
                <el-checkbox label="代理店发行"></el-checkbox>
                <el-checkbox label="出版社发行"></el-checkbox>
              </el-checkbox-group>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="电子签约种类" prop="contractTyoeOnline">
              <el-checkbox-group v-model="form.contractTyoeOnline" placeholder="请选择发行者">
                <el-checkbox label="AdobeSign"></el-checkbox>
                <el-checkbox label="DocuSign"></el-checkbox>
                <el-checkbox label="其他"></el-checkbox>
              </el-checkbox-group>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            电子签约邮件寄送：
          </el-col>
          <el-col :span="12">
            <el-form-item label="To" prop="to" label-width="100px">
              <el-select v-model="form.to" placeholder="请选择">
                <el-option
                  v-for="item in toList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="CC" prop="cc" label-width="100px">
              <el-select v-model="form.cc" placeholder="请选择">
                <el-option
                  v-for="item in ccList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <div class="small_title">
              <div class="blur_point"></div>
              <span>事业部名称/业务负责人</span>
            </div>
          </el-col>
          <div v-for="(i, index) in form.chargePersonCauseList" :key="index">
            <el-col :span="8">
              <el-form-item :label="'部门名称' + (index + 1)" label-width="100">
                <el-input v-model="i.section" :placeholder="'请输入部门名称' + (index + 1)" />
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item :label="'业务负责人' + (index + 1)" label-width="100">
                <el-input v-model="i.chargePersonName" :placeholder="'请输入业务负责人' + (index + 1)" />
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item :label="'电邮' + (index + 1)" label-width="100">
                <el-input v-model="i.email" :placeholder="'请输入电邮' + (index + 1)" />
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item :label="'电话号码' + (index + 1)" label-width="100">
                <el-input v-model="i.phone" :placeholder="'请输入电话号码' + (index + 1)" />
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item :label="'手机号码' + (index + 1)" label-width="100">
                <el-input v-model="i.mobilePhone" :placeholder="'请输入手机号码' + (index + 1)" />
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item :label="'SNS' + (index + 1)" label-width="100">
                <el-input v-model="i.sns" :placeholder="'请输入SNS' + (index + 1)" />
              </el-form-item>
            </el-col>
          </div>
          <el-col :span="24">
            <div class="small_title">
              <div class="blur_point"></div>
              <span>会计负责人</span>
            </div>
          </el-col>
          <div v-for="(i, index) in form.chargePersonAccountantList" :key="index">
            <el-col :span="6">
              <el-form-item :label="'部门名称' + (index + 1)" label-width="100">
                <el-input v-model="i.section" :placeholder="'请输入部门名称' + (index + 1)" />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item :label="'会计负责人' + (index + 1)" label-width="100">
                <el-input v-model="i.chargePersonName" :placeholder="'请输入会计负责人' + (index + 1)" />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item :label="'电邮' + (index + 1)" label-width="100">
                <el-input v-model="i.email" :placeholder="'请输入电邮' + (index + 1)" />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item :label="'电话号码' + (index + 1)" label-width="100">
                <el-input v-model="i.phone" :placeholder="'请输入电话号码' + (index + 1)" />
              </el-form-item>
            </el-col>
          </div>
          <el-col :span="24">
            <div class="small_title">
              <div class="blur_point"></div>
              <span>银行信息</span>
            </div>
          </el-col>
          <el-col :span="12"
            ><el-form-item label="银行名称(当地名称)" prop="bankNameLocal">
              <el-input
                v-model="form.bankNameLocal"
                placeholder="请输入银行名称(当地名称)"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="银行名称(英文)" prop="bankNameEng">
              <el-input
                v-model="form.bankNameEng"
                placeholder="请输入银行名称(英文)"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="银行地址(当地)" prop="bankAddressLocal">
              <el-input
                v-model="form.bankAddressLocal"
                placeholder="请输入银行地址(当地)"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="银行地址(英文)" prop="bankAddressEng">
              <el-input
                v-model="form.bankAddressEng"
                placeholder="请输入银行地址(英文)"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item
              label="银行账户名称(当地)"
              prop="bankAccountNameLocal"
            >
              <el-input
                v-model="form.bankAccountNameLocal"
                placeholder="请输入银行账户名称(当地)"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="银行账户名称(英文)" prop="bankAccountNameEng">
              <el-input
                v-model="form.bankAccountNameEng"
                placeholder="请输入银行账户名称(英文)"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="银行账户号码" prop="bankAccountNumber">
              <el-input
                v-model="form.bankAccountNumber"
                placeholder="请输入银行账户号码"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="SWIFT CODE" prop="swiftCode">
              <el-input
                v-model="form.swiftCode"
                placeholder="请输入SWIFT CODE"
              /> </el-form-item
          ></el-col>
          <el-col :span="24">
            <div class="small_title">
              <div class="blur_point"></div>
              <span>发票相关</span>
            </div>
          </el-col>
          <el-col :span="12"
            ><el-form-item label="发票的公司名" prop="invoiceCompanyName">
              <el-input
                v-model="form.invoiceCompanyName"
                placeholder="请输入发票的公司名"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item
              label="同一发票号码/纳税人识别号"
              label-width="230px"
              prop="invoiceNumber"
            >
              <el-input
                v-model="form.invoiceNumber"
                placeholder="请输入同一发票号码/纳税人识别号"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="地址/电话" prop="invoicePhone">
              <el-input
                v-model="form.invoicePhone"
                placeholder="请输入地址/电话"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="开户行及账号" prop="bankDeposit">
              <el-input
                v-model="form.bankDeposit"
                placeholder="请输入开户行及账号"
              /> </el-form-item
          ></el-col>
          <el-col :span="12">
            <el-form-item label="开票时间" prop="invoiceTime">
              <el-radio-group v-model="form.invoiceTime">
                <el-radio :label="1">权利人收款前</el-radio>
                <el-radio :label="2">权利人收款后</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="开票种类" prop="invoiceType">
              <el-radio-group v-model="form.invoiceType">
                <el-radio :label="1">普通发票</el-radio>
                <el-radio :label="2">专用发票</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="发票增值税" prop="invoiceAddedTax">
              <el-radio-group v-model="form.invoiceAddedTax">
                <el-radio :label="1">内含税</el-radio>
                <el-radio :label="2">外加税</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <div class="small_title">
              <div class="blur_point"></div>
              <span>公司概要</span>
            </div>
          </el-col>
          <el-col :span="12"
            ><el-form-item label="公司成立日期" prop="companyCreatedTime">
              <el-date-picker
                clearable
                v-model="form.companyCreatedTime"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="请选择公司成立日期"
              >
              </el-date-picker> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="年度营业额" prop="annualTurnover">
              <el-input
                v-model="form.annualTurnover"
                placeholder="请输入年度营业额"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="出版书种" prop="publishedBookType">
              <el-input
                v-model="form.publishedBookType"
                placeholder="请输入出版书种"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item
              label="原创作品和翻译作品之比例"
              label-width="180px"
              prop="rawTranslateScale"
            >
              <el-input
                v-model="form.rawTranslateScale"
                placeholder="请输入原创作品和翻译作品之比例"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="资本额" prop="capitalAmount">
              <el-input
                v-model="form.capitalAmount"
                placeholder="请输入资本额"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="员工人数" prop="employeesNumber">
              <el-input
                v-model="form.employeesNumber"
                placeholder="请输入员工人数"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="全年出版书种的数量" prop="yearPublishNumber">
              <el-input
                v-model="form.yearPublishNumber"
                placeholder="请输入全年出版书种的数量"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="股东" prop="stockholder">
              <el-input
                v-model="form.stockholder"
                placeholder="请输入股东"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="经营项目 " prop="operatingItems">
              <el-input
                v-model="form.operatingItems"
                placeholder="请输入经营项目 "
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="累计出版书种的数量" prop="allPublishNumber">
              <el-input
                v-model="form.allPublishNumber"
                placeholder="请输入累计出版书种的数量"
              /> </el-form-item
          ></el-col>
          <el-col :span="12"
            ><el-form-item label="销售渠道" prop="salesChannel">
              <el-input
                v-model="form.salesChannel"
                placeholder="请输入销售渠道"
              /> </el-form-item
          ></el-col>
          <el-col :span="24"
            ><el-form-item
              label="自制畅销书名、原出版社、发行数量"
              label-width="250px"
              prop="originalBook"
            >
              <el-input
                v-model="form.originalBook"
                type="textarea"
                :maxlength="500"
                placeholder="请输入内容"
              /> </el-form-item
          ></el-col>
          <el-col :span="24"
            ><el-form-item label-width="250px" label="翻译畅销书名、发行数量" prop="translateBook">
              <el-input
                v-model="form.translateBook"
                type="textarea"
                :maxlength="500"
                placeholder="请输入内容"
              /> </el-form-item
          ></el-col>
          <el-col :span="24"
            ><el-form-item
              label="来往之国外出版社(欧美/日本等)"
              label-width="250px"
              prop="foreignPublishingHouse"
            >
              <el-input
                v-model="form.foreignPublishingHouse"
                type="textarea"
                :maxlength="300"
                placeholder="请输入内容"
              /> </el-form-item
          ></el-col>
          <el-col :span="24"
            ><el-form-item label-width="250px" label="来往之版全代理公司名" prop="copyrightAgency">
              <el-input
                v-model="form.copyrightAgency"
                :maxlength="100"
                type="textarea"
                placeholder="请输入来往之版全代理公司名"
              /> </el-form-item
          ></el-col>
          <el-col :span="24">
            <div class="small_title">
              <div class="blur_point"></div>
              <span>备注</span>
            </div>
          </el-col>
          <el-col :span="24"
            ><el-form-item label="业务上注意点" prop="businessNoticePoint">
              <el-input
                v-model="form.businessNoticePoint"
                type="textarea"
                :maxlength="1000"
                placeholder="请输入内容"
              /> </el-form-item
          ></el-col>
          <el-col :span="24"
            ><el-form-item label="合同上注意点" prop="contractNoticePoint">
              <el-input
                v-model="form.contractNoticePoint"
                type="textarea"
                :maxlength="1000"
                placeholder="请输入内容"
              /> </el-form-item
          ></el-col>
          <el-col :span="24"
            ><el-form-item label="付款上注意点" prop="payNoticePoint">
              <el-input
                v-model="form.payNoticePoint"
                type="textarea"
                :maxlength="1000"
                placeholder="请输入内容"
              /> </el-form-item
          ></el-col>
          <el-col :span="24"
            ><el-form-item label="其它" prop="othera">
              <el-input
                v-model="form.othera"
                type="textarea"
                :maxlength="1000"
                placeholder="请输入内容"
              /> </el-form-item
          ></el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  listHouse,
  getHouse,
  delHouse,
  addHouse,
  updateHouse,
} from "@/api/system/house";

export default {
  name: "House",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 出版社表格数据
      houseList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        publisherNumber: null,
        publishType: null,
        publishName: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        publisherNumber: [
          { required: true, message: "出版社编号不能为空", trigger: "blur" },
        ],
        publishType: [
          { required: true, message: "出版社类型不能为空", trigger: "blur" },
        ],
        publishName: [
          { required: true, message: "出版社名不能为空", trigger: "blur" },
        ],
        publishNameLogined: [
          {
            required: true,
            message: "出版社名(注册)不能为空",
            trigger: "blur",
          },
        ],
        address: [{ required: true, message: "地址不能为空", trigger: "blur" }],
        publishNameInContract: [
          {
            required: true,
            message: "合同上的出版社名不能为空",
            trigger: "blur",
          },
        ],
        addressInContract: [
          { required: true, message: "合同上地址不能为空", trigger: "blur" },
        ],
        contractRepresentative: [
          { required: true, message: "签约代表人不能为空", trigger: "blur" },
        ],
        position: [
          { required: true, message: "职称不能为空", trigger: "blur" },
        ],
        phone: [{ required: true, message: "电话不能为空", trigger: "blur" }],
        fax: [{ required: true, message: "传真不能为空", trigger: "blur" }],
      },
      obligeeTypeList: [
        {
          value: 1,
          label: '童书'
        },
        {
          value: 2,
          label: '成人'
        },
        {
          value: 3,
          label: '综合'
        },
      ],
      // TO数据
      toList: [
        {
          value: 1,
          label: '签约代表人'
        },
        {
          value: 2,
          label: '窗口'
        }
      ],
      // CC数据
      ccList: [
        {
          value: 1,
          label: '签约代表人'
        },
        {
          value: 2,
          label: '窗口'
        },
        {
          value: 3,
          label: '无'
        },
      ],
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询出版社列表 */
    getList() {
      this.loading = true;
      listHouse(this.queryParams).then((response) => {
        this.houseList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        publisherNumber: null,
        publishType: null,
        publishName: null,
        publishNameEng: null,
        publishNameLogined: null,
        publishNameLoginedEng: null,
        address: null,
        addressEng: null,
        publishNameInContract: null,
        publishNameInContractEng: null,
        addressInContract: null,
        addressInContractEng: null,
        companyChargePeople: null,
        companyChargePeopleEng: null,
        contractRepresentative: null,
        contractRepresentativeEng: null,
        position: null,
        positionEng: null,
        phone: null,
        fax: null,
        email: null,
        officialWebsite: null,
        signWay: [],
        publisher: [],
        contractTyoeOnline: [],
        to: null,
        cc: null,
        bankNameLocal: null,
        bankNameEng: null,
        bankAddressLocal: null,
        bankAddressEng: null,
        bankAccountNameLocal: null,
        bankAccountNameEng: null,
        bankAccountNumber: null,
        swiftCode: null,
        invoiceCompanyName: null,
        invoiceNumber: null,
        invoicePhone: null,
        bankDeposit: null,
        invoiceTime: null,
        invoiceType: null,
        invoiceAddedTax: null,
        companyCreatedTime: null,
        annualTurnover: null,
        publishedBookType: null,
        rawTranslateScale: null,
        capitalAmount: null,
        employeesNumber: null,
        yearPublishNumber: null,
        stockholder: null,
        operatingItems: null,
        allPublishNumber: null,
        salesChannel: null,
        originalBook: null,
        translateBook: null,
        foreignPublishingHouse: null,
        copyrightAgency: null,
        businessNoticePoint: null,
        contractNoticePoint: null,
        payNoticePoint: null,
        othera: null,
        chargePersonCauseList: [
          {
            section: "",
            chargePersonName: "",
            email: "",
            phone: "",
            mobilePhone: "",
            sns: "",
            type: 1,
            toolType: 1,
          },
          {
            section: "",
            chargePersonName: "",
            email: "",
            phone: "",
            mobilePhone: "",
            sns: "",
            type: 1,
            toolType: 0,
          },
          {
            section: "",
            chargePersonName: "",
            email: "",
            phone: "",
            mobilePhone: "",
            sns: "",
            type: 1,
            toolType: 0,
          },
          {
            section: "",
            chargePersonName: "",
            email: "",
            phone: "",
            mobilePhone: "",
            sns: "",
            type: 1,
            toolType: 0,
          },
        ],
        chargePersonAccountantList: [
          {
            section: "",
            chargePersonName: "",
            email: "",
            phone: "",
            mobilePhone: "",
            sns: "",
            type: 0,
            toolType: 0,
          },
          {
            section: "",
            chargePersonName: "",
            email: "",
            phone: "",
            mobilePhone: "",
            sns: "",
            type: 0,
            toolType: 0,
          },
          {
            section: "",
            chargePersonName: "",
            email: "",
            phone: "",
            mobilePhone: "",
            sns: "",
            type: 0,
            toolType: 0,
          }
        ],
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map((item) => item.id);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加出版社";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids;
      getHouse(id, 0).then((response) => {
        this.form = response.data;
        this.form.signWay = this.form.signWay.split(',')
        this.form.publisher = this.form.publisher.split(',')
        this.form.contractTyoeOnline = this.form.contractTyoeOnline.split(',')
        this.open = true;
        this.title = "修改出版社";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          let form = JSON.parse(JSON.stringify(this.form))
          form.signWay = form.signWay.join(',')
          form.publisher = form.publisher.join(',')
          form.contractTyoeOnline = form.contractTyoeOnline.join(',')
          if (this.form.id != null) {
            updateHouse(form).then((response) => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addHouse(form).then((response) => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal
        .confirm('是否确认删除出版社编号为"' + ids + '"的数据项？')
        .then(function () {
          return delHouse(ids);
        })
        .then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        })
        .catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download(
        "system/house/export",
        {
          ...this.queryParams,
        },
        `house_${new Date().getTime()}.xlsx`
      );
    },
  },
};
</script>
<style scoped>
.small_title {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
}
.blur_point {
  width: 10px;
  height: 10px;
  background-color: #1890ff;
  border-radius: 10px;
  margin-right: 5px;
}
</style>